var Map = (function() {
	// 初始化
	 
	function Map() {	
		// 属性 
		this.view="2d";
		this.map2d=new Map2D();	
		//this.ol3d=new Map3D();
		this.init();		
	}
	//
	//初始化
	Map.prototype.init = function(mapdiv) {
		
		//this.ol3d.initol3d(this);
		//初始化一个图层顺序，要不，后边加载图层的时候可能会被压盖
		//this.loadbase2d();
		//this.loadbase3d();
	};
	//修改背景
	Map.prototype.setbasemap = function(options) {
		if(this.view==="2d"){
			this.map2d.setbasemap(options);
		}else if(this.view==="3d"){
			
		}else if(this.view==="23d"){
			this.map2d.setbasemap(options);
		}	 
	};
	
	Map.prototype.loadbase3d = function() {
		var that=this;
		var layers=_.sortBy(layerconfig, 'index');
		$.each(layers,function(index,val){
			
		});
	};
	Map.prototype.loadbase2d = function() {
		var layers=_.sortBy(layerconfig, 'index');
		$.each(layers,function(index,val){
			 var tmpLayer = new ol.layer.Vector({
                 id: val.id,
                 opacity: 0.95,
                 maxzoom: 1224,
                 minzoom: 0.0001
             });
			 that.ol2d.olmap.addLayer(tmpLayer);
		});
	};

	
	// 返回
	return Map;
})();

